<?php


namespace App\Libs;


use http\Exception\RuntimeException;

class TokenGenerator
{
    public static function generate($length = 64)
    {
        try {
            return (new \Tokenly\TokenGenerator\TokenGenerator())->generateToken($length, env('APP_KEY'));
        } catch (\Exception $e) {
            throw new RuntimeException("Token generate failed");
        }
    }
}